<@admin.html >
	<div class="title">
					<h1>新闻管理</h1>
					<span class="tTip"></span>
				</div>
				<div class="box">
					<form name="searchForm" id="searchForm" method="post" action="${base}/admin/news/">
						<div class="tx_table" style="margin-bottom:7px;">
							<div class="data">
								<h2>新闻列表</h2>
								<table>
									<tbody>
										<tr style="background:#dcf7fe;">
											<td>
												新闻标题：
												<input class="Q" type="text" name="title" value="${(title)!}" size="26" />
												状         态 :
												<select name="status" class="Q" >
													<option value="-1"<#if status==-1>selected="true"</#if>>--请选择--</option>
													<option value="0" <#if status==0>selected="true"</#if> >草稿</option>
													<option value="1" <#if status==1>selected="true"</#if> >发布</option>
													<option value="2" <#if status==2>selected="true"</#if> >作废</option>
												</select>
											</td>
										</tr>
									</tbody>
								</table>
								<div class="tx_sender">
									<input class="step" name="" type="submit" value="查 找" />
								</div>
							</div>
						</div>
					</form>
					
					<form name="frontForm" id="frontForm" method="post" action="${base}/admin/news/index!front">
						<input type="hidden" name="id" value="" id="hidden_front_id">
					</form>
					
					<form name="unfrontForm" id="unfrontForm" method="post" action="${base}/admin/news/index!unfront">
						<input type="hidden" name="id" value="" id="hidden_unfront_id">
					</form>
						<div class="tx_table" id="news_list">
							
								<div class="data">
									<div class="tx_sender l_tr" style="padding:5px 10px;">
										<input class="step" name="" type="button" value="添加新闻" onclick="window.location='${base}/admin/news/index!add'"/>							
									</div>
									<table class="l_tc">
										<caption>新闻列表</caption>
										<thead>
											<tr>
												<th>新闻标题</th>
												<th>当前状态</th>
												<th>是否首页显示</th>
												<th>创建时间</th>
												<th>操作</th>
											</tr>
										</thead>
										<tbody>
										<#if newsPage??>
										<#list newsPage.result as news>
											<tr <#if news_index%2 != 0> class="c_odd" </#if>>
												<td>
													<a class="c_modi" href="${base}/news!show?id=${(news.id?c)}" target="_blank">${(news.title)!}</a>
												</td>
												<td>
													<#if news.status==0>草稿</#if>
													<#if news.status==1>发布</#if>
													<#if news.status==2>作废</#if>
												</td>
												<td>
													<#if news.front==0>否</#if>
													<#if news.front==1>是</#if>
												</td>
												<td>${news.publishDate?string("yyyy-MM-dd")!}</td>
												<td>
													<a class="c_modi" href="${base}/admin/news/index!add?id=${(news.id?c)}">编辑</a>
													<#if news.front==0>
														<a class="c_modi" style="cursor:pointer;" onClick="frontNews(${(news.id?c)})">首页显示</a>
													</#if>
													<#if news.front==1>
														<a class="c_modi" style="cursor:pointer;" onClick="unfrontNews(${(news.id?c)})">首页不显示</a>
													</#if>
													<a class="c_modi" style="cursor:pointer;" onClick="delNews('${news.id?c}')">删除</a>
												</td>
											</tr>
										</#list>	
										</#if>						
										</tbody>
									</table>
								</div>
							<@admin.pagination_admin div="news_list" />
						</div>
				</div>
<script>
		function delNews(id){
		if(window.confirm("你确认删除该条官方发布吗？该操作无法撤销.")){
			window.location.href="${base}/admin/news/index!remove?id=" + id;
		}
	}
	
	function frontNews(id){
		if(id!=""){
			var result = confirm("确定要进行该操作吗？");
			if(result){
				$("#hidden_front_id").val(id);
				$("#frontForm").submit();
			}
			
		}
	}
	
	function unfrontNews(id){
		if(id!=""){
			var result = confirm("确定要进行该操作吗？");
			if(result){
				$("#hidden_unfront_id").val(id);
				$("#unfrontForm").submit();
			}
		}
	}
</script>
</@admin.html >